﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_TaiKhoanChiPhiTraTruoc : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("BtPhai")]
        private Button _BtPhai;
        [AccessedThroughProperty("BtTrai")]
        private Button _BtTrai;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("GroupBox2")]
        private GroupBox _GroupBox2;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("TxtSearchCode")]
        private TextBox _TxtSearchCode;
        [AccessedThroughProperty("TxtSearchName")]
        private TextBox _TxtSearchName;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        [AccessedThroughProperty("VSTaiKhoanChiPhi")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSTaiKhoanChiPhi;
        private IContainer components;
        private DataView objData;
        private clsDMTaiKhoan objTK;

        public Frm_TaiKhoanChiPhiTraTruoc()
        {
            base.Load += new EventHandler(this.Frm_TaiKhoanChiPhiTraTruoc_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objTK = new clsDMTaiKhoan();
            this.InitializeComponent();
        }

        private void BtPhai_Click(object sender, EventArgs e)
        {
            if ((this.VSList.Rows.Count != 1) && (this.VSList.Row > 0))
            {
                string pSoTK = "";
                string pKhoaTK = "";
                pKhoaTK = Conversions.ToString(this.VSList[this.VSList.Row, 0]);
                pSoTK = Conversions.ToString(this.VSList[this.VSList.Row, 1]);
                if (this.objTK.AddTKChiPhi(pKhoaTK, pSoTK))
                {
                    this.VSTaiKhoanChiPhi.AddItem("");
                    this.VSTaiKhoanChiPhi[this.VSTaiKhoanChiPhi.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(this.VSList[this.VSList.Row, 0]);
                    this.VSTaiKhoanChiPhi[this.VSTaiKhoanChiPhi.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(this.VSList[this.VSList.Row, 1]);
                    this.VSTaiKhoanChiPhi[this.VSTaiKhoanChiPhi.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(this.VSList[this.VSList.Row, 2]);
                    this.VSList.RemoveItem(this.VSList.Row);
                }
            }
        }

        private void BtTrai_Click(object sender, EventArgs e)
        {
            if ((this.VSTaiKhoanChiPhi.Rows.Count != 1) && (this.VSTaiKhoanChiPhi.Row > 0))
            {
                string pKhoaTK = "";
                pKhoaTK = Conversions.ToString(this.VSTaiKhoanChiPhi[this.VSTaiKhoanChiPhi.Row, 0]);
                if (this.objTK.DelTKChiPhi(pKhoaTK))
                {
                    this.LoadTaiKhoan();
                    this.LoadTaiKhoanChiPhiTraTruoc();
                }
            }
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_TaiKhoanChiPhiTraTruoc_Load(object sender, EventArgs e)
        {
            this.LoadTaiKhoan();
            this.LoadTaiKhoanChiPhiTraTruoc();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_TaiKhoanChiPhiTraTruoc));
            this.GroupBox1 = new GroupBox();
            this.Panel1 = new Panel();
            this.TxtSearchName = new TextBox();
            this.TxtSearchCode = new TextBox();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.GroupBox2 = new GroupBox();
            this.VSTaiKhoanChiPhi = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.BtTrai = new Button();
            this.BtPhai = new Button();
            this.CmdCancel = new Button();
            this.GroupBox1.SuspendLayout();
            this.Panel1.SuspendLayout();
            this.VSList.BeginInit();
            this.GroupBox2.SuspendLayout();
            this.VSTaiKhoanChiPhi.BeginInit();
            this.SuspendLayout();
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.Panel1);
            this.GroupBox1.Controls.Add(this.VSList);
            Point point = new Point(4, 7);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(0x131, 0x1b5);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 1;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "Danh mục t\x00e0i khoản";
            this.Panel1.Controls.Add(this.TxtSearchName);
            this.Panel1.Controls.Add(this.TxtSearchCode);
            point = new Point(2, 0x193);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x12d, 0x1d);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x36;
            point = new Point(0x5b, 3);
            this.TxtSearchName.Location = point;
            this.TxtSearchName.Name = "TxtSearchName";
            size = new Size(0xd0, 20);
            this.TxtSearchName.Size = size;
            this.TxtSearchName.TabIndex = 1;
            point = new Point(0, 3);
            this.TxtSearchCode.Location = point;
            this.TxtSearchCode.Name = "TxtSearchCode";
            size = new Size(90, 20);
            this.TxtSearchCode.Size = size;
            this.TxtSearchCode.TabIndex = 0;
            this.VSList.AllowEditing = false;
            this.VSList.AutoResize = false;
            this.VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSList.ColumnInfo = "3,0,0,0,0,85,Columns:0{Caption:\"Kh\x00f3a\";Visible:False;}\t1{Caption:\"Số t\x00e0i khoản\";Style:\"DataType:System.String;TextAlign:LeftCenter;\";}\t2{Caption:\"T\x00ean t\x00e0i khoản\";}\t";
            this.VSList.ExtendLastCol = true;
            this.VSList.FocusRect = FocusRectEnum.None;
            point = new Point(4, 0x13);
            this.VSList.Location = point;
            this.VSList.Name = "VSList";
            this.VSList.Rows.Count = 1;
            this.VSList.Rows.DefaultSize = 0x11;
            this.VSList.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x12a, 0x17d);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 0x35;
            this.GroupBox2.BackColor = Color.Transparent;
            this.GroupBox2.Controls.Add(this.VSTaiKhoanChiPhi);
            point = new Point(0x15c, 7);
            this.GroupBox2.Location = point;
            this.GroupBox2.Name = "GroupBox2";
            size = new Size(0x131, 0x197);
            this.GroupBox2.Size = size;
            this.GroupBox2.TabIndex = 2;
            this.GroupBox2.TabStop = false;
            this.GroupBox2.Text = "T\x00e0i khoản chi ph\x00ed trả trước";
            this.VSTaiKhoanChiPhi.AllowEditing = false;
            this.VSTaiKhoanChiPhi.AutoResize = false;
            this.VSTaiKhoanChiPhi.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSTaiKhoanChiPhi.ColumnInfo = "3,0,0,0,0,85,Columns:0{Caption:\"Kh\x00f3a\";Visible:False;}\t1{Caption:\"Số t\x00e0i khoản\";Style:\"DataType:System.String;TextAlign:LeftCenter;\";}\t2{Caption:\"T\x00ean t\x00e0i khoản\";}\t";
            this.VSTaiKhoanChiPhi.ExtendLastCol = true;
            this.VSTaiKhoanChiPhi.FocusRect = FocusRectEnum.None;
            point = new Point(4, 0x13);
            this.VSTaiKhoanChiPhi.Location = point;
            this.VSTaiKhoanChiPhi.Name = "VSTaiKhoanChiPhi";
            this.VSTaiKhoanChiPhi.Rows.Count = 1;
            this.VSTaiKhoanChiPhi.Rows.DefaultSize = 0x11;
            this.VSTaiKhoanChiPhi.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x12a, 0x17d);
            this.VSTaiKhoanChiPhi.Size = size;
            this.VSTaiKhoanChiPhi.StyleInfo = manager.GetString("VSTaiKhoanChiPhi.StyleInfo");
            this.VSTaiKhoanChiPhi.TabIndex = 0x35;
            this.BtTrai.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(0x139, 0xcb);
            this.BtTrai.Location = point;
            this.BtTrai.Name = "BtTrai";
            size = new Size(0x1f, 0x17);
            this.BtTrai.Size = size;
            this.BtTrai.TabIndex = 0x3e;
            this.BtTrai.Text = "<";
            this.BtTrai.UseVisualStyleBackColor = true;
            this.BtPhai.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(0x139, 0xae);
            this.BtPhai.Location = point;
            this.BtPhai.Name = "BtPhai";
            size = new Size(0x1f, 0x17);
            this.BtPhai.Size = size;
            this.BtPhai.TabIndex = 0x3d;
            this.BtPhai.Text = ">";
            this.BtPhai.UseVisualStyleBackColor = true;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x242, 0x1a2);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x49, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x3f;
            this.CmdCancel.Text = "Th&o\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x290, 0x1bd);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.BtTrai);
            this.Controls.Add(this.BtPhai);
            this.Controls.Add(this.GroupBox2);
            this.Controls.Add(this.GroupBox1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_TaiKhoanChiPhiTraTruoc";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "DINH NGHIA TAI KHOAN CHI PHI TRA TRUOC";
            this.GroupBox1.ResumeLayout(false);
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSList.EndInit();
            this.GroupBox2.ResumeLayout(false);
            this.VSTaiKhoanChiPhi.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadTaiKhoan()
        {
            this.objData = new DataView(this.objTK.ShowListByField("Khoa|SoTaiKhoan|Ten" + modGeneral.H_LANGUAGE, "CapDo = 1 and Khoa not in (SELECT KhoaTaiKhoan FROM GL_TaiKhoanChiPhiTraTruoc)", " SoTaiKhoan "));
            this.VSList.DataSource = this.objData;
            C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
            vSList.Cols[0].Visible = false;
            vSList.Cols[1].Width = 80;
            vSList[0, 1] = modGeneral.Tranlated("Số t\x00e0i khoản", "");
            vSList[0, 2] = modGeneral.Tranlated("T\x00ean t\x00e0i khoản", "");
            vSList = null;
        }

        public void LoadTaiKhoanChiPhiTraTruoc()
        {
            this.objData = new DataView(this.objTK.ShowListByField("Khoa|SoTaiKhoan|Ten" + modGeneral.H_LANGUAGE, "CapDo = 1 and Khoa in (SELECT KhoaTaiKhoan FROM GL_TaiKhoanChiPhiTraTruoc)", " SoTaiKhoan "));
            this.VSTaiKhoanChiPhi.DataSource = this.objData;
            C1.Win.C1FlexGrid.C1FlexGrid vSTaiKhoanChiPhi = this.VSTaiKhoanChiPhi;
            vSTaiKhoanChiPhi.Cols[0].Visible = false;
            vSTaiKhoanChiPhi.Cols[1].Width = 80;
            vSTaiKhoanChiPhi[0, 1] = modGeneral.Tranlated("Số t\x00e0i khoản", "");
            vSTaiKhoanChiPhi[0, 2] = modGeneral.Tranlated("T\x00ean t\x00e0i khoản", "");
            vSTaiKhoanChiPhi = null;
        }

        internal virtual Button BtPhai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._BtPhai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.BtPhai_Click);
                if (this._BtPhai != null)
                {
                    this._BtPhai.Click -= handler;
                }
                this._BtPhai = value;
                if (this._BtPhai != null)
                {
                    this._BtPhai.Click += handler;
                }
            }
        }

        internal virtual Button BtTrai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._BtTrai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.BtTrai_Click);
                if (this._BtTrai != null)
                {
                    this._BtTrai.Click -= handler;
                }
                this._BtTrai = value;
                if (this._BtTrai != null)
                {
                    this._BtTrai.Click += handler;
                }
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual GroupBox GroupBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox2 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual TextBox TxtSearchCode
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchCode;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSearchCode = value;
            }
        }

        internal virtual TextBox TxtSearchName
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchName;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSearchName = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSList = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSTaiKhoanChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSTaiKhoanChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSTaiKhoanChiPhi = value;
            }
        }
    }
}

